<div id="mainContent">

<form  name="myForm" id="myForm" method="post" action="<?=site_url()?>Matching/confirm">
<table width="1000px" border="0" cellspacing="0" cellpadding="0" align="center" >
	<tr align="center">
    	<td> <h2>รายการที่สำเร็จ</h2><hr/> 
    	</td>
    </tr>
    <tr style="height:10px;">
    	<td></td>
    </tr>
	<tr>
		<td align="center">          
                  <table width="100%" border="0" cellspacing="2px" cellpadding="0">
                      <tr bgcolor="#000099">
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">ชื่อนักเรียน</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">ชั้น</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">วิชา</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">ชื่อติวเตอร์</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">วันที่นักเรียนสมัคร</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">วันเวลาเรียน</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">สถานที่</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">ผู้บันทึก</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">หมายเหตุ</div></td>
                      </tr>
                      <?php  $monthTh = array("","ม.ค.","ก.พ. ","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
                      		$i = 1;
							foreach ($selected_stu as $row) {
								echo '<tr align="left"';
								if($i % 2 == 0) {
									echo ' bgColor=#c6e2ff ';
								}
								$i++;
								echo '>';
								echo '<td><a href="StudentInfo/detail/'.$row->student_id .'" target="_blank">' . $row->first_name . ' ' . $row->last_name . '</a></td>';
								echo '<td>' . $row->current_class . '</td>';
								echo '<td>' . $row->subject . '</td>';
								echo '<td><a href="TutorInfo/detail/'.$row->tutor_id .'" target="_blank">' . $row->first_name_th . ' ' . $row->last_name_th . '</a></td>';
								echo '<td align="center">' . strftime("%d",strtotime($row->create_date)) . ' ' . $monthTh[ (int) strftime("%m",strtotime($row->create_date))]. '</td>';
								echo '<td>' . $row->dayy . ' ' . $row->time . '</td>';
								
								echo '<td>' . $row->study_add_distinct . ' ' . $row->study_add_area . '</td>';
								echo '<td>' . $row->approve_by . '</td>';
								
								echo '<td width="300">' . $row->match_note . '</td>';
		                      	echo '</tr>';
							}
                      ?>
                  <tr style="height: 10px;">
                    <td align="right"></td>
                    <td align="left"></td>
                  </tr>
              </table>
		</td>
	</tr>
	<tr>
    	<td align="center"><?php echo $paging;?></td>
    </tr>
    <tr style="height:10px;">
    	<td></td>
    </tr>
</table>
<input type="hidden" name="txtId" id="txtId" />
</form>
</div>
<script type="text/javascript">
function toBlack(obj) {
	obj.src = '<?=base_url()?>images/detail_b.png';
}
function toColor(obj) {
	obj.src = '<?=base_url()?>images/detail.png';
}
function setID(obj) {
	document.getElementById('txtId').value = obj.value;
	var frm = document.forms["myForm"];
	frm.action = "<?=site_url()?>TutorInfo/detail/"+obj.value;
	frm.submit();
}
</script>